www.gusucode.com > XerCMS 携云PHP企业建站程序 v2015PHP源码程序 > XerCMS 携云PHP企业建站程序 v2015/XerCMS_v20150724/XerCMS_v20150724/XerCMS/Utils/tag/XerCMS_extends.php

    <?php
/**
 * @name     XERCMS
 * @author   Arno <XerCMS@163.com> [QQ:1328013]
 * @version  1.0.0
 * @link     http://www.XerCMS.com 
 */

!defined('XERCMS') && exit('Access Denied');

class XERCMS_TAG_EXTENDS
{
     public function nav($param,$html,$layer) {
          $sql = 'display = 1';
          $sql .= isset($param['id']) ? ' AND id in ('.php::dvar($param['id']).')' : '';
          $sql .= isset($param['parent']) ? ' AND parent in ('.php::dvar($param['parent']).')' : '';
          $sql .= isset($param['limit']) ? ' LIMIT '.$param['limit'] : ' LIMIT 30';
          $sql = 'SELECT * FROM xercms_nav WHERE '.$sql;
          $val = php::dfor($param);
          return '<?php $data_'.$layer.' = '.(isset($param['cache']) ? 'Cache::fetchSql(\''.$sql.'\','.(int)$param['cache'].')' : 'DB::fetch_all(\''.$sql.'\')').';foreach($data_'.$layer.' as '.$val.') { ?>'.$html.'<?php } ?>';
     }

     public function sVar($param,$html,$layer) {
          global $G;
		  if(!isset($param['file']) || empty($param['file']))
		       return '';
          $val = php::dfor($param);
          return '<?php $data_'.$layer.' = sVar(\''.$param['file'].'\');foreach($data_'.$layer.' as '.$val.') { ?>'.$html.'<?php } ?>';
     }
	 
     public function slides($param,$html,$layer) {
          $sql = 'SELECT * FROM xercms_slides'.(isset($param['sign']) ? ' WHERE sign = "'.$param['sign'].'"' : '').' ORDER BY mtime DESC LIMIT 0,'.(isset($param['limit']) ? $param['limit'] : '15');
          $val = php::dfor($param);
          return '<?php $data_'.$layer.' = '.(isset($param['cache']) ? 'Cache::fetchSql(\''.$sql.'\','.(int)$param['cache'].')' : 'DB::fetch_all(\''.$sql.'\')').';foreach($data_'.$layer.' as '.$val.') { ?>'.$html.'<?php } ?>';
     }
	 
     public function activity() {
    
     }

     public function announce($param,$html,$layer) {
          $sql = isset($param['limit']) ? ' LIMIT '.$param['limit'] : ' LIMIT 1';
          $sql = 'SELECT a.id,a.uid,a.title,a.time,a.hits,a.detail,a.rely,m.nick FROM xercms_announce a,xercms_member_profile m WHERE  a.uid = m.uid ORDER BY a.`time` DESC'.$sql;
          $val = php::dfor($param);
          return '<?php $data_'.$layer.' = '.(isset($param['cache']) ? 'Cache::fetchSql(\''.$sql.'\','.(int)$param['cache'].')' : 'DB::fetch_all(\''.$sql.'\')').';foreach($data_'.$layer.' as '.$val.') { ?>'.$html.'<?php } ?>';
     }

     public function guestbook() {
    
     }
	 
     public function special() {
    
     }
}
?>